import Vue from 'vue'
import App from './App'
import ELEMENT from 'element-ui'
import 'src/assets/sys.less'
import store from 'src/store/sys-store'
import {common} from 'src/service/common'
import router from 'src/router/sys-router'


router.afterEach((to, from) => {
  if (store.state.errorMessage != null) {
    setTimeout(function () {
      ELEMENT.Message({
        message: store.state.errorMessage,
        type: 'error'
      })
      store.commit("errorMessage", null);
    }, 200);
  }
});
Vue.use(ELEMENT);
common.app(function () {
  const vue = new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: {App}
  })
  common.vue = vue;
  return vue;
}).then(function (v) {
  console.info('如果需要系统请联系 QQ:35107793')
});

